package mortal.game.resource
{
	import com.gengine.resource.*;
	import flash.utils.*;
	import mortal.game.resource.info.*;
	
	public class ColorConfig extends Object
	{
		private var _dataColor:Dictionary;
		private static var _instance:ColorConfig;
		
		public function ColorConfig(param1:ConstructorBlock)
		{
			this._dataColor = new Dictionary();
			if (_instance != null)
			{
				throw new Error(" ColorConfig 单例 ");
			}
			_instance = this;
			this.parseColorXML(ConfigManager.instance.getObjectByFileName("color.xml"));
			
		}
		
		private function parseColorXML(param1:Object) : void
		{
			var _loc_3:Object = null;
			var _loc_4:String = null;
			var _loc_5:Object = null;
			var _loc_6:ColorInfo = null;
			var _loc_2:* = param1.items as Array;
			for each (_loc_3 in _loc_2)
			{
				
				_loc_4 = _loc_3.type.toString();
				for each (_loc_5 in _loc_3.item as Array)
				{
					
					_loc_6 = new ColorInfo();
					_loc_6.type = _loc_4;
					_loc_6.color = _loc_5.value;
					_loc_6.id = _loc_5.id;
					_loc_6.colorText = _loc_5.text;
					this.addItem(_loc_6);
				}
			}
			
		}
		
		public function addItem(param1:ColorInfo) : void
		{
			this._dataColor[param1.type + "-" + param1.id] = param1;
			
		}
		
		public function getItem(param1:String, param2:String) : ColorInfo
		{
			return this._dataColor[param1 + "-" + param2] as ColorInfo;
		}
		
		public function getItemColor(param1:int) : ColorInfo
		{
			return this._dataColor["item" + "-" + param1];
		}
		
		public function getRumorColor(param1:int) : ColorInfo
		{
			return this._dataColor["rumor" + "-" + param1];
		}
		
		public function getItemColorString(param1:int) : String
		{
			var _loc_2:String = "";
			var _loc_3:* = this.getItemColor(param1);
			if (_loc_3)
			{
				_loc_2 = _loc_3.color;
			}
			return _loc_2;
		}
		
		public function getCampColor(param1:int) : ColorInfo
		{
			return this._dataColor["country" + "-" + param1];
		}
		
		public function getCountryColor(param1:int) : ColorInfo
		{
			var _loc_2:* = this._dataColor["country" + "-" + param1];
			if (!_loc_2)
			{
				_loc_2 = this._dataColor["country-0"];
			}
			return _loc_2;
		}
		
		public function getChatColor(param1:String) : ColorInfo
		{
			return this._dataColor["chat" + "-" + param1];
		}
		
		public function getVIPColor(param1:int) : ColorInfo
		{
			var _loc_2:* = this._dataColor["vip" + "-" + param1];
			if (!_loc_2)
			{
				_loc_2 = this._dataColor["vip-1"];
			}
			return _loc_2;
		}
		
		public function getTaskColor(param1:String) : ColorInfo
		{
			return this._dataColor["task" + "-" + param1];
		}
		
		public function getChartsColor(param1:int) : ColorInfo
		{
			return this._dataColor["charts" + "-" + param1];
		}
		
		public function getCoinColor(param1:int) : ColorInfo
		{
			return this._dataColor["coin" + "-" + param1];
		}
		
		public function getGoldColor(param1:int) : ColorInfo
		{
			return this._dataColor["gold" + "-" + param1];
		}
		
		public function getCycleColor(param1:int) : ColorInfo
		{
			return this._dataColor["cycle" + "-" + param1];
		}
		
		public function getMountAddValue(param1:int) : ColorInfo
		{
			return this._dataColor["MountAddValue-" + param1];
		}
		
		public static function get instance() : ColorConfig
		{
			if (_instance == null)
			{
				_instance = new ColorConfig(new ConstructorBlock());
			}
			return _instance;
		}
		
	}
}

class ConstructorBlock extends Object
{
	
	function ConstructorBlock()
	{
		
	}
	
}

